# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libresource
pkgver=0.25.1
pkgrel=1
_commit_dbusgmain="d42176ae4763e5288ef37ea314fe58387faf2005"
pkgdesc="Nemo's libresource"
url="https://github.com/sailfishos/libresource"
arch="all"
license="LGPL-2.1-only AND (AFL-2.1 OR GPL-2.0-or-later)"
depends_dev="
	check-dev
	dbus-dev
	dbus-glib-dev
	"
makedepends="$depends_dev
	autoconf
	automake
	libtool
	"
subpackages="$pkgname-static $pkgname-dev"
source="https://github.com/sailfishos/libresource/archive/$pkgver/libresource-$pkgver.tar.gz
	https://github.com/sailfishos-mirror/dbus-glib/archive/$_commit_dbusgmain/dbus-glib-$_commit_dbusgmain.tar.gz
	"
options="!check" # No suitable tests

prepare() {
	default_prepare

	rmdir dbus-gmain
	mv "$srcdir/dbus-glib-$_commit_dbusgmain" dbus-gmain
}

build() {
	./autogen.sh
	./configure \
		--prefix=/usr
	make -j1 # For some reason it breaks otherwise
}

package() {
	DESTDIR="$pkgdir" make install

	# Remove tests
	rm -rf "$pkgdir"/opt
}

sha512sums="
c60d6badec533cd569b0ad7b5cddb0a5fb9853e2fb9c23a679bba66777c2ced6a7a00f0a308542aacb23297f4210aca177ca8c61f3b9812a509a04c1d68a5f26  libresource-0.25.1.tar.gz
665cd6395ee0ea14086ba30188c62a72697b3f63484681e18fc7f54109c9aca162f2e33aa2fa4d45287c6c0b590e81ca310c143dac0232cd5887692cdaf51256  dbus-glib-d42176ae4763e5288ef37ea314fe58387faf2005.tar.gz
"
